import torch
from argparse import ArgumentParser
from model.networks import define_G
from data import build_dataloader
from tqdm import tqdm

from utils.metrics import runningScore
from utils.my_logging import Logger

## BIT_CD中的模型转换成当前项目的模型

state = torch.load("pretrained/pos_s4.pt", map_location="cpu")

for k in state.keys():
    if "model_G_state_dict" == k:
        state = state[k]


torch.save(
    state, "pretrained/pos_s4_converted.pt", _use_new_zipfile_serialization=False
)
